package com.example.food_contract_system.controller;

import com.example.food_contract_system.domain.Freeze;
import com.example.food_contract_system.service.FreezeService;
import com.example.food_contract_system.util.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author LiHaoyang
 * @date 2023/7/13  15:51
 **/
@RestController
@RequestMapping("/freeze")
public class FreezeController {

    @Autowired
    private FreezeService freezeService;

    @PostMapping("/insertFreeze")
    public R insertFreeze(@RequestBody Freeze freeze){
        R result = freezeService.insertFreeze(freeze);
        return result;
    }

    @GetMapping("/thawAgency/{aId}")
    public R thawAgency(@PathVariable("aId") String aId){
        R result = freezeService.thawAgency(aId);
        return result;
    }

    @GetMapping("/getFreezeById/{aId}")
    public R getFreezeById(@PathVariable("aId") String aId){
        R result = freezeService.getFreezeById(aId);
        return result;
    }

    @GetMapping("/thawAgencyApply/{appId}")
    public R thawAgencyApply(@PathVariable("appId") String appId){
        R result = freezeService.thawAgencyApply(appId);
        return result;
    }
}

